package Bird;

public class Penguin extends Bird 
{
   

   private FlyBahavior flyBehavior;
   private SwimBehavior swimBehavior;
   public Penguin(FlyBahavior fly, SwimBehavior swim)
   {
      System.out.println("企鹅");
      this.flyBehavior = fly;
      this.swimBehavior = swim;
   }
   @Override
   public void display(){
      this.flyBehavior.fly();
      this.swimBehavior.swim();
   }
}
